package com.banyuan.HomeWork.多线程;

//1、有一个字符串“abcdefg”,要求每秒钟倒序打印一个字符。
public class QuestionOne {
    public static void main(String[] args) {
        String s = "abcdefg";
        Thread th = new Thread() {
            @Override
            public void run() {
                try {
                    for (int i = 0; i < s.length(); i++) {
                        Thread.sleep(1000);
                        System.out.print(s.charAt(i));
                    }
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

            }
        };
        th.start();

    }
}
